/**
 * @FileName Composite.java
 * @Package com.designMode.composite
 * -------------------------------------
 * @function Please write description of function
 * @Date 2016-1-18 下午2:32:28
 * -------------------------------------
 * Copyright (c) 2016,顾博君 All Rights Reserved.
 */
package com.designMode.composite;

import java.util.ArrayList;

/**
 * @author 顾博君
 * @ClassName Composite
 * @Date 2016-1-18 下午2:32:28
 * @Function 树枝构件
 */
public class Composite extends Component {
    private ArrayList<Component> componentArrayList = new ArrayList<>();

    public void add(Component param) {
        this.componentArrayList.add(param);
    }

    public void remove(Component param) {
        this.componentArrayList.remove(param);
    }

    public ArrayList<Component> getChild() {
        return this.componentArrayList;
    }

    @Override
    public void operation() {
        System.out.println("Composite->operation()");
    }
}
